#pragma once
#pragma execution_character_set("utf-8")
#include <QObject>
#include <CworkThreadBase.h>
#include <QJSEngine>
#include <QJSValue>
#include <QTextStream>
#include <QFile>
#include <QDebug>
#include <GlobalData.h>
class MyObject : public QObject
{
	Q_OBJECT
public:
	Q_INVOKABLE int add(int a, int b) { return a + b; }

	Q_INVOKABLE void log(QString message) {
		qDebug() << message;
	}
};




class WorkThread  : public CworkThreadBase
{

public:
	WorkThread();
	~WorkThread();

	int addData();

	void addJavscript();

	 int run() override;

	  void start(int interval)  override;



private:
	QStringList m_data ;
	int m_currentIndex = 0;
	QString script;
	QJSEngine engine;
	MyObject myObject;
	GlobalData globalData;


};
